package com.order.web;

import java.io.IOException;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.order.dao.HotelEvaQuery;
import com.order.dao.VegeEvaQuery;
import com.order.dao.bean.HotelEva;
import com.order.dao.bean.VegeEvaluate;

@WebServlet("/HotelEvaServlet")
public class HotelEvaServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    public HotelEvaServlet() {
        super();
    }


	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request,response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.setContentType("text/html;charset=gbk");
    	request.setCharacterEncoding("gbk");
    	List<HotelEva> list = HotelEvaQuery.queryAll();

    	if(list!=null)
    	{
    		request.setAttribute("hotelEvaList",list);	
       		RequestDispatcher rd=request.getRequestDispatcher("/hotelEvaluate.jsp");
            rd.forward(request,response);
    	}	
	}

}
